package com.sjq.demo.controller;


import com.alibaba.fastjson.JSONObject;
import com.sjq.demo.response.Result;
import com.sjq.demo.service.LoginService;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 工资表 前端控制器
 * </p>
 *
 * @author yer
 * @since 2020-12-24
 */
@RestController
@RequestMapping("/login")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/login")
    public Result login(@RequestBody JSONObject params){
        String username = params.getString("username");
        String password = params.getString("password");
        return Result.ok(loginService.login(username,password));
    }
}
